import Vue from 'vue'
import Router from 'vue-router'
//import HelloWorld from '@/components/HelloWorld'
import Login from '@/components/Login'
import Index from '@/components/Index'
import Department from '@/components/Department'
import Administrator from '@/components/Administrator'
import VueRouter from 'vue-router'
//import bottomBar from './components/BottomBar';

Vue.use(Router)

const router = new VueRouter({
	//	mode: 'history',
	routes: [

		{
			path: '/', // 登录页
			name: 'Login',
			component: Login,
			meta: {
				unNeedAuth: true,
				allowBack: false,
			},
		},
		{
			path: '/index', // 首页
			name: 'Index',
			component: Index,
			meta: {
				needBottomBar: true,
				allowBack: false,
			},
		},
				{
			path: '/administrator', // 管理员管理	
			name: 'Administrator',
			component: Administrator,
			meta: {
				needBottomBar: true,
				allowBack: false,
			},
		},
		{
			path: '/department', // 部门管理
			name: 'Department',
			component: Department,
			meta: {
				needBottomBar: true,
				allowBack: false,
			},
		}
	]
})
//router.beforeEach((to, from, next) => {
//var userInfo= JSON.parse(sessionStorage.getItem('userInfoStorage'));//获取浏览器缓存的用户信息
//if(userInfo){//如果有就直接到首页咯
//  next();
//}else{
//  if(to.path=='/login'){//如果是登录页面路径，就直接next()
//    next();
//  }else{//不然就跳转到登录；
//    next('/login');
//  }
//
//}
//});
export default router;